import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

/**
 * @author Kevin
 * @Data 2020/12/7
 */
public class Delete {
        public static void main(String[] args) throws Exception {
        Class.forName("com.mysql.cj.jdbc.Driver");//加载驱动

        String jdbc="jdbc:mysql://localhost:3306/test";
        Connection conn= DriverManager.getConnection(jdbc, "root", "bwk123");//链接到数据库

        Statement state=conn.createStatement();   //容器
        String sql="delete from student where sex='12'";   //SQL语句
        state.executeUpdate(sql);         //将sql语句上传至数据库执行

        conn.close();//关闭通道

    }
}